<?php
define('SCRIPT_EXP_RELATIVE','');
define('SCRIPT_FILENAME','popup.php');

// 8/14/2009 : immanuel192 change this line to make it like index.php
ob_start();

// Initialize the Exponent Framework
require_once('exponent.php');

// if the user has turned on sef_urls then we need to route the request, otherwise we can just 
// skip it and default back to the old way of doing things.
$router->routeRequest();
$section = $router->getSection();
$sectionObj = $router->getSectionObj($section);

// set the output header
header("Content-Type: text/html; charset=".LANG_CHARSET);

// Initialize the Theme Subsystem
if (!defined('SYS_THEME')) require_once(BASE.'subsystems/theme.php');

$loc = exponent_core_makeLocation(
	(isset($_GET['module'])?$_GET['module']:''),
	(isset($_GET['src'])?$_GET['src']:''),
	(isset($_GET['int'])?$_GET['int']:'')
);

//$SYS_FLOW_REDIRECTIONPATH='popup';

if (exponent_theme_inAction()) {
	exponent_theme_runAction();
} else if (isset($_GET['module']) && isset($_GET['view'])) {
	// Immanuel192 remove this line because we don't want flow set
  //exponent_flow_set(SYS_FLOW_PUBLIC,SYS_FLOW_SECTIONAL);

	$mod = new $_GET['module']();
	$mod->show($_GET['view'],$loc,(isset($_GET['title'])?$_GET['title']:''));
}

$str = ob_get_contents();
ob_end_clean();

$template = new standalonetemplate('popup_'.(isset($_GET['template'])?$_GET['template']:'general'));
$template->assign('output',$str);
$template->output();

?>